package net.sourceforge.pinyin4j;

import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;

class PinyinFormatter
{
  private static String convertToneNumber2ToneMark(String paramString)
  {
    int i;
    int j;
    int k;
    int l;
    String str = paramString.toLowerCase();
    if (str.matches("[a-z]*[1-5]?"))
    {
      if (!(str.matches("[a-z]*[1-5]")))
        break label254;
      i = Character.getNumericValue(str.charAt(-1 + str.length()));
      j = str.indexOf(97);
      k = str.indexOf(101);
      l = str.indexOf("ou");
      if (-1 == j)
        break label175;
    }
    for (int i1 = 97; ; i1 = 36)
    {
      while (true)
      {
        if ((36 != i1) && (-1 != j))
        {
          label69: int i2 = "aeiouv".indexOf(i1);
          char c = "āáăàaēéĕèeīíĭìiōóŏòoūúŭùuǖǘǚǜü".charAt(i - 1 + i2 * 5);
          StringBuffer localStringBuffer = new StringBuffer();
          localStringBuffer.append(str.substring(0, j).replaceAll("v", "ü"));
          localStringBuffer.append(c);
          localStringBuffer.append(str.substring(j + 1, -1 + str.length()).replaceAll("v", "ü"));
          str = localStringBuffer.toString();
        }
        return str;
        if (-1 != k)
        {
          label175: j = k;
          i1 = 101;
        }
        if (-1 == l)
          break;
        i1 = "ou".charAt(0);
        j = l;
      }
      for (j = -1 + str.length(); ; --j)
      {
        if (j < 0)
          break label263;
        if (!(String.valueOf(str.charAt(j)).matches("[aeiouv]")))
          continue;
        i1 = str.charAt(j);
        break label69:
      }
      label254: return str.replaceAll("v", "ü");
      label263: j = -1;
    }
  }

  static String formatHanyuPinyin(String paramString, HanyuPinyinOutputFormat paramHanyuPinyinOutputFormat)
    throws BadHanyuPinyinOutputFormatCombination
  {
    if ((HanyuPinyinToneType.WITH_TONE_MARK == paramHanyuPinyinOutputFormat.getToneType()) && (((HanyuPinyinVCharType.WITH_V == paramHanyuPinyinOutputFormat.getVCharType()) || (HanyuPinyinVCharType.WITH_U_AND_COLON == paramHanyuPinyinOutputFormat.getVCharType()))))
      throw new BadHanyuPinyinOutputFormatCombination("tone marks cannot be added to v or u:");
    if (HanyuPinyinToneType.WITHOUT_TONE == paramHanyuPinyinOutputFormat.getToneType())
    {
      paramString = paramString.replaceAll("[1-5]", "");
      label59: if (HanyuPinyinVCharType.WITH_V != paramHanyuPinyinOutputFormat.getVCharType())
        break label120;
    }
    for (paramString = paramString.replaceAll("u:", "v"); ; paramString = paramString.replaceAll("u:", "ü"))
      do
      {
        if (HanyuPinyinCaseType.UPPERCASE == paramHanyuPinyinOutputFormat.getCaseType())
          paramString = paramString.toUpperCase();
        return paramString;
        if (HanyuPinyinToneType.WITH_TONE_MARK == paramHanyuPinyinOutputFormat.getToneType());
        paramString = convertToneNumber2ToneMark(paramString.replaceAll("u:", "v"));
        label120: break label59:
      }
      while (HanyuPinyinVCharType.WITH_U_UNICODE != paramHanyuPinyinOutputFormat.getVCharType());
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     net.sourceforge.pinyin4j.PinyinFormatter
 * JD-Core Version:    0.5.2
 */